USE [DTP]
GO

/****** Object:  Table [dbo].[t_AccidentToVehicle]    Script Date: 11/26/2010 16:35:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[t_AccidentToPerson](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[AccidentID] [bigint] NOT NULL,
	[PersonId] [bigint] NOT NULL,
	[Deleted] [tinyint] NULL,
 CONSTRAINT [PK_AccidentToPerson] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[t_AccidentToPerson]  WITH CHECK ADD  CONSTRAINT [FK_AccidentID] FOREIGN KEY([AccidentID])
REFERENCES [dbo].[t_AccidentCards] ([ID])
GO

ALTER TABLE [dbo].[t_AccidentToPerson] CHECK CONSTRAINT [FK_AccidentID]
GO

ALTER TABLE [dbo].[t_AccidentToPerson]  WITH CHECK ADD  CONSTRAINT [FK_PersonId] FOREIGN KEY([PersonId])
REFERENCES [dbo].[t_PersonCards] ([ID])
GO

ALTER TABLE [dbo].[t_AccidentToPerson] CHECK CONSTRAINT [FK_PersonId]
GO

ALTER TABLE [dbo].[t_AccidentToPerson] ADD  DEFAULT ((0)) FOR [Deleted]
GO


